package com.example.mapper;

import com.example.entity.Customer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.mapstruct.Mapper;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CustomerMapper {
    @Insert("insert into mall_backend.customer(name, password, category, address,create_time,update_time) " +
            "values (#{name},#{password},#{category},#{address},#{createTime},#{updateTime})")
    void insert(String name, String password, Integer category, String address,LocalDateTime createTime,LocalDateTime updateTime);

    @Delete("delete from mall_backend.customer where id= #{id}")
    void delete(Integer id);

    void update(Integer id, String name, String password, Integer category, String address,LocalDateTime updateTime);

    List<Customer> select(Integer id, String name, Integer category, String address);
}
